/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */
#ifndef __PQ_FileBase_H__
#define __PQ_FileBase_H__

#include <assert.h>
#include <string>

namespace PQCore
{
	/*abstract class for the concept of file
	*/
	class FileBase
	{
	public:
		FileBase(std::string fileName)
			:_filename(fileName)
		{

		}
		
		inline std::string getFileName()
		{
			return _filename;
		}

		virtual size_t read(void* dest, size_t bytes)=0;
		virtual int getSize()=0;
		virtual int getPos()=0;
		virtual void* getBuffer()=0;
		virtual void seek(int offset)=0;
		virtual int getPosition()=0;
		virtual void open()=0;
		virtual void close()=0;
		virtual bool eof()=0;
		virtual void advance(int offset)=0;

	protected:
		std::string _filename;
		bool _opened;
		bool _eof;
	};
}
#endif
